<%@page import="controller.webservice.WebServiceCtrl"%>

<%@ taglib prefix="stripes"
	uri="http://stripes.sourceforge.net/stripes-dynattr.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<jsp:useBean id="JsonUtil" scope="page" class="util.JsonUtil" />


<stripes:layout-render name="/admin/master-page.jsp">

	<stripes:layout-component name="head">

	</stripes:layout-component>

	<stripes:layout-component name="content">


		<div class="container">
			<div class="row">
				<h1 class="text-center">
					<b>Bootstrap</b>
				</h1>

				<div class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title">Bootstrap Status</h3>
					</div>
					<h4 class="panel-body">
						CSV data loaded with <span
							class="label label-${actionBean.bootstrapCtrl.hasLoadingErrors() ? "danger" : "success" }">${actionBean.bootstrapCtrl.status }</span>
					<span class="label label-danger">${result }</span>  and  <span class="label label-success">Round 1 started</span>
					</h4>
				</div>

				<div class="panel panel-info">
					<div class="panel-heading">
						<h3 class="panel-title">Number of Files Loaded</h3>
					</div>

					<table class="table table-striped">
						<thead>
							<tr>
								<th>File</th>
								<th>Number Of Rows Loaded</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${actionBean.bootstrapCtrl.numRowsLoaded}"
								var="eachFileMap">
								<tr>
									<td>${eachFileMap.key }</td>
									<td>${eachFileMap.value }</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>


				<div class="panel panel-danger">
					<div class="panel-heading">
						<h3 class="panel-title">Errors</h3>
					</div>

					<table class="table table-striped">
						<thead>
							<tr>
								<th>File</th>
								<th>Line Number</th>
								<th>Error Messages</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${actionBean.bootstrapCtrl.rowErrors}"
								var="eachRowError">
								<tr>
									<td>${eachRowError.file }</td>
									<td>${eachRowError.line }</td>
									<td>${JsonUtil.getCommaSeperatedErrorMessages(eachRowError.message) }</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>


			</div>
		</div>

	</stripes:layout-component>

	<stripes:layout-component name="end">

	</stripes:layout-component>
</stripes:layout-render>



